package my.study.org.apache.commons.pool;

import org.apache.commons.pool.PoolableObjectFactory;

public class ServicePoolableObjectFactory implements PoolableObjectFactory {
	private static int id = 0;
	public void activateObject(Object arg0) throws Exception {
		System.out.println("ServicePoolableObjectFactory.activateObject()");
		
	}

	public void destroyObject(Object arg0) throws Exception {
		System.out.println("ServicePoolableObjectFactory.destroyObject()");
		
	}

	public Integer makeObject() throws Exception {
		System.out.println("ServicePoolableObjectFactory.makeObject()");
		Integer value = new Integer(id);
		id++;
		return value;
	}

	public void passivateObject(Object arg0) throws Exception {
		System.out.println("ServicePoolableObjectFactory.passivateObject()");
		
	}

	public boolean validateObject(Object arg0) {
		System.out.println("ServicePoolableObjectFactory.validateObject()");
		return false;
	}

}
